#pragma once
#include<iostream>
#include<deque>
#include<vector>
using namespace std;

template <class T, class Con = deque<T>>

class Stack
{
public:

    void push(const T& x)
    {
        _stack.push_back(x);
    }

    void pop()
    {
        _stack.pop_back();
    }

    T& top()
    {
        return _stack[_stack.size()-1];
    }

    const T& top()const
    {
        return _stack[_stack.size() - 1];
    }

    size_t size()const
    {
        return _stack.size();
    }

    bool empty()const
    {
        return _stack.empty();
    }

private:
    //vector<T> _stack;
    deque<T> _stack;
};
void test1()
{
    Stack<int> s;
    s.push(1);
    s.push(2);
    s.push(3);
    s.push(4);
    while (!s.empty())
    {
        int a = s.top();
        s.pop();
        cout << a << " ";
    }
}
